// pages/parkService/parkService.js
var app = getApp();
var util = require('../../utils/util.js');
var applet_park_api_url = app.globalData.applet_park_api_url;
var applet_park_api_url_imgUrl = app.globalData.applet_park_api_url_imgUrl;
Page({
  /**
   * 页面的初始数据
   */
  data: {
    currenttab: '',
    customerServiceshow: false,
    directo: false,
    imgUrl: applet_park_api_url_imgUrl,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var userRoles = wx.getStorageSync("userRoles");
    //客服
    if (userRoles.indexOf('customerService') != -1) {
      this.setData({
        customerServiceshow: true
      })
    }
    //主管
    if ((userRoles.indexOf('engineeringSupervisor') != -1) || (userRoles.indexOf('safetySupervisor') != -1) || (userRoles.indexOf('environmentalSupervisor') != -1)) {
      this.setData({
        directo: true
      })

    }
  },
  packBp(e) {
    this.setData({
      currenttab: e.currentTarget.dataset.index
    })
  },
  toMaintenance() {
    var id = wx.getStorageSync("id");
    if (!id) {
      wx.showToast({
        title: '请先登录',
      })
      return

    }
    // pages / maintenanceDetail / maintenanceDetail
    wx.navigateTo({
      url: '../maintenanceList/maintenancelist',
    })
  },
  enterPolicy() { //园区政策
    wx.navigateTo({
      url: '../../packageC/pages/policy/policy',
    })
  },
  goStopCar() { //停车缴费
    wx.navigateTo({
      url: '../../packageF/pages/stop_pay/stop_pay',
    })
  },
  enterParkrental() { //园区租赁
    wx.navigateTo({
      url: '../../packageF/pages/parkrental/parkrental',
    })
  },
  enterParkDynamics() { //园区动态
    wx.navigateTo({
      url: '../../packageC/pages/parkDynamics/parkDynamics',
    })
  },
  enterScientificser() { //科研服务
    wx.navigateTo({
      url: '../../packageC/pages/scientificser/scientificser',
    })
  },
  enterParkActivity() { //园区活动
    wx.navigateTo({
      url: '../../packageC/pages/parkActivity/parkActivity',
    })
  },
  enterPublic() { //公共信息发布
    wx.navigateTo({
      url: '../../packageD/pages/publicissue/publicissue',
    })
  },
  enterVoice() { //发票
    wx.navigateTo({
      url: '../../packageE/pages/applybill/applybill',
    })
  },
  enterParkPayment() { //园区缴费
    wx.navigateTo({
      url: '../../packageG/pages/parkPayment/parkPayment',
    })
  },
  enterFarm() { //农场
    wx.navigateTo({
      url: '../../packageH/pages/farmIndex/farmIndex',
    })
  },
  enterLaboratory() { //实验室
    wx.navigateTo({
      url: '../../packageI/pages/laboratoryList/laboratoryList',
    })
  },
  toApplyMaintenance() {
    // pages / maintenanceDetail / maintenanceDetail
    var id = wx.getStorageSync("id");
    if (!id) {
      wx.showToast({
        title: '请先登录',
      })
      return

    }
    wx.navigateTo({
      url: '../applyMaintenance/applyMaintenance',
    })
  },
  toPatrol: function () {
    var id = wx.getStorageSync("id");
    if (!id) {
      wx.showToast({
        title: '请先登录',
      })
      return

    }
    wx.navigateTo({
      url: '../patrol_list/patrol_list',
    })
  },
  // 去房屋租赁
  goParkServes() {
    wx.navigateTo({
      url: '../../packageB/pages/parkrental/parkrental',
    })
  },
  // 会议
  meetinging() {
    wx.navigateTo({
      url: '../../packageA/pages/MeetingLIat/MeetingLIat',
    })
  },
  // 访客
  victormanger() {
    wx.navigateTo({
      url: '../../packageA/pages/visitorIndex/visitorIndex',
    })
  },
  // 餐厅
  gorestaurant() {
    wx.navigateTo({
      // url: '../restaurantHomepage/restaurantHomepage',
      url: '../choiceRestaurant/choiceRestaurant',
    })
  },
  // 车辆
  enterCar() {
    wx.navigateTo({
      url: '../../packageB/pages/plate_manage/manage',
    })
  },
  // 耗材
  enterConsumables() {
    wx.navigateTo({
      url: '../../packageI/pages/storageList/storageList',
    })
  },
  // 抄表
  enterChaobiao(){
    wx.navigateTo({
      url: '../../packageI/pages/meter/meter',
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})